'use strict';

angular.module('snPaas_om')
.directive('spToggleClass',[function(){
    return {
      restrict:'A',
      priority:-1,
      // controller:function(){},
      link:function postLink(scope,iElement,iAttrs){
        var className = iAttrs.spToggleClass;

        iElement.on('click',function(e){
          if(iElement.hasClass(className)){
            iElement.removeClass(className);
          }
          else{
            iElement.addClass(className);

          }
        });
        iElement.find('.sp-no-toggle').on('click',function(e){
          e.stopPropagation();
        });
      }
   }

}]);
